 package srdb.migration.schema.metadata;
 
 public class Grant extends DBObject
 {
   private String grantee;
   private String owner;
   private String objectName;
   private String grantor;
   private String privilege;
   private boolean grantable;
   private PRIV_TYPE privilegeType;
 
   public Grant()
   {
     this.privilegeType = PRIV_TYPE.OBJECT;
   }
 
   public String getGrantee()
   {
     return this.grantee;
   }
 
   public void setGrantee(String grantee)
   {
     this.grantee = grantee;
   }
 
   public String getOwner()
   {
     return this.owner;
   }
 
   public void setOwner(String owner)
   {
     this.owner = owner;
   }
 
   public String getObjectName()
   {
     return this.objectName;
   }
 
   public void setObjectName(String objectName)
   {
     this.objectName = objectName;
   }
 
   public String getGrantor()
   {
     return this.grantor;
   }
 
   public void setGrantor(String grantor)
   {
     this.grantor = grantor;
   }
 
   public String getPrivilege()
   {
     return this.privilege;
   }
 
   public void setPrivilege(String privilege)
   {
     this.privilege = privilege;
   }
 
   public boolean isGrantable()
   {
     return this.grantable;
   }
 
   public void setGrantable(boolean grantable)
   {
     this.grantable = grantable;
   }
 
   public PRIV_TYPE getPrivilegeType() {
     return this.privilegeType;
   }
 
   public void setPrivilegeType(PRIV_TYPE privilegeType) {
     this.privilegeType = privilegeType;
   }
 
   public String getName()
   {
     return getPrivilege();
   }
 
   public DBObject getParent()
   {
     return null;
   }
 
   public String getSchema()
   {
     return getOwner();
   }
 
   public String getFullName()
   {
     if (this.privilegeType == PRIV_TYPE.OBJECT) {
       return getPrivilege() + " on " + getSchema() + "." + getObjectName() + " to " + getGrantee();
     }
     return getObjectName() + " to " + getGrantee();
   }
 
   public static enum PRIV_TYPE
   {
     OBJECT, 
     ROLE;
 
     public String getString()
     {
       switch (Grant.PRIV_TYPE.values()[ordinal()]) {
       case OBJECT:
         return "Object";
       case ROLE:
         return "Role";
       }
 
       throw new AssertionError("Unknown type: " + this);
     }
   }
 }

/* 

 * 
 */